package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Member;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface MemberDao {
    public List<Member> findAll();
    public Page<Member> selectByCondition(String queryString);
    public void add(Member member);
    public void deleteById(Integer id);
    public Member findById(Integer id);
    public Member findByTelephone(String telephone);
    public void edit(Member member);
    public Integer findMemberCountBeforeDate(String date);
    public Integer findMemberCountByDate(String date);
    public Integer findMemberCountAfterDate(String date);
    public Integer findMemberTotalCount();

    int checkOrder(HashMap<String, Object> check);
    void editNameById(Order order);

    public Member findMemberByTelephone(String phoneNumber);

    public void updateById(Member member);

    public String findPassword(String phoneNumber);

    public void updatePassword(@Param("password") String newpassword,@Param("phoneNumber") String phoneNumber2);

    public Integer findIdByTelephone(String telephone);

    void updatephoneNumber(@Param("id") Integer id,@Param("phoneNumber") String telephone);

    public Integer findUserIfExist(@Param("telephone")String telephone,@Param("password") String password);

    Page<Member> queryPage(String queryString);
    Integer findRelevance(Integer id);

    List<String> findManagerByRoleId();

    List<Map<String,Object>> findNames(Integer id);

    int countMonths(String month);

}
